package com.pctx.bibaregisterlogin.controller;

import com.pctx.bibacommon.result.Result;
import com.pctx.bibaregisterlogin.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
@RequestMapping("/register")
public class RegisterController {
  @Autowired
    private RegisterService registerService;

    @RequestMapping("/registerUser")
    public Result registerUser(@RequestParam("username")String username, @RequestParam("realpassword")String realpassword,
                               @RequestParam("mobile")String mobile, @RequestParam("type")int type) {
       return registerService.registerUser(username,realpassword,mobile,type);


    }
  @RequestMapping("/registerCompany")
  public Result registerCompany(String username, String password, String companyName, String companyIndustry,
                                String companyScale, String location, String contactName, String contactPhone) {
      return registerService.registerCompany(username, password,companyName,companyIndustry,
              companyScale,location, contactName,contactPhone);
  }

}
